package cn.wolfcode.wolf2w.repostiory;


import cn.wolfcode.wolf2w.domain.Travel;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 游记持久层接口
 */
@Repository
public interface TravelRepository extends MongoRepository<Travel, String>{

    /**
     * 根据目的地id查游记前三
     * @param destId
     * @param pageable
     * @return
     */
    List<Travel> findByDestId(String destId, Pageable pageable);

    /**
     * 目的地名查游记集合
     * @param keyword
     * @return
     */
    List<Travel> queryByDestName(String keyword);
}
